package pack0901;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class DemoE {
    public static void main(String[] args) throws Exception{
        //可变线程池
        ExecutorService es = Executors.newCachedThreadPool();
        DemoE1 e1 = new DemoE1();
        DemoE1 e2 = new DemoE1();
        DemoE1 e3 = new DemoE1();
        es.execute(e1);
        Thread.sleep(100);
        es.execute(e2);
        es.execute(e3);
    }
}
class DemoE1 implements Runnable{
    @Override
    public void run() {
        System.out.println("aaa"+Thread.currentThread().getName());
    }
}